<?php

class TreeTest extends navCtrl{
    
    
    public function test() {
        require_once VFW_PATH.'dataStructs/Trees.php';
        
        $at = new AVLTree();
        
        $at->insert(6);
        $at->insert(9);
        $at->insert(8);
        $at->insert(10);
        $at->insert(4);
        $at->insert(5);
        $at->insert(3);
        $at->insert(2);
        $at->insert(1);
        $at->intabella();
        
        
        echoa($at->path_to(5)->getAll());

        
        $parenti = array (
        	array('id' => '2.1.1', 	'parent' => '2.1'),
        	array('id' => '1', 		'parent' => ''),
        	array('id' => '2.1', 	'parent' => '2'),
        	array('id' => '1.1', 	'parent' => '1'),
        	array('id' => '1.1.1', 	'parent' => '1.1'),
        	array('id' => '2', 		'parent' => ''),
        	array('id' => '1.2.1', 	'parent' => '1.2'),
       		array('id' => '1.2', 	'parent' => '1'),
        	array('id' => '2.2.1', 	'parent' => '2.2'),
       		array('id' => '2.2', 	'parent' => '2'),
       		array('id' => '2.2.2', 	'parent' => '2.2')
       		
        		
        );
        
        
        $parenale = new ParentalTree($parenti);
        $parenale->insert(array('id' => '1.1.1.2.1', 'parent' => '1.1.1.2'));
        $parenale->insert(array('id' => '1.2.1.1', 'parent' => '1.2.1'));
        $parenale->insert(array('id' => '1.1.1.1', 'parent' => '1.1.1'));
        $parenale->insert(array('id' => '1.1.1.2', 'parent' => '1.1.1'));
        
        $parenale->insert(array('id' => '3.1', 'parent' => '3'));
        $parenale->insert(array('id' => '3', 'parent' => ''));
        
        $parenale->printacazz();
        
      
        
        
        
        $this->response->messaggio('compila');
        $this->response->setTpl('AppDefault/messageBox.html');
        
    }
    
    
    
}